
using System.Windows;

namespace MvvmFx.Common.Helpers
{
    /// <summary>
    /// Static utility class with methods for manipulating guid's
    /// </summary>
    public static class ClipboardHelper
    {
        #region Copy

        /// <summary>
        /// Places a specified data object on the system Clipboard. The data is removed from
        /// the Clipboard when the application exits.
        /// </summary>
        /// <param name="data">The data to place on the Clipboard.</param>
        public static void Copy(object data)
        {
            Clipboard.SetDataObject(data);
        }

        /// <summary>
        /// Places a specified data object on the system Clipboard.
        /// </summary>
        /// <param name="data">The data to place on the Clipboard.</param>
        /// <param name="copy">If true, the data is left on the Clipboard when the application exists.</param>
        public static void Copy(object data, bool copy)
        {
            Clipboard.SetDataObject(data, copy);
        }

        /// <summary>
        /// Places a specified data object on the system Clipboard. The data is removed from
        /// the Clipboard when the application exits.
        /// </summary>
        /// <param name="data">The data to place on the Clipboard.</param>
        /// <param name="dataFormat">The format of the data to be stored on the Clipboard.</param>
        public static void Copy(object data, string dataFormat)
        {
            DataObject dataObject = new DataObject(dataFormat, data);
            Clipboard.SetDataObject(dataObject, false);
        }

        /// <summary>
        /// Places a specified data object on the system Clipboard.
        /// </summary>
        /// <param name="data">The data to place on the Clipboard.</param>
        /// <param name="dataFormat">The format of the data to be stored on the Clipboard.</param>
        /// <param name="copy">If true, the data is left on the Clipboard when the application exists.</param>
        public static void Copy(object data, string dataFormat, bool copy)
        {
            DataObject dataObject = new DataObject(dataFormat, data);
            Clipboard.SetDataObject(dataObject, copy);
        }

        #endregion

        #region Paste

        /// <summary>
        /// Get ths data object on the clipboard
        /// </summary>
        /// <returns></returns>
        public static object Paste()
        {
            return Clipboard.GetDataObject();

        }

        #endregion
    }
}